<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/2/21 0021
 * Time: 21:43
 */
$server = new Swoole\Server('0.0.0.0', 9800, SWOOLE_PROCESS, SWOOLE_SOCK_UDP);
$server->on('packet',function(Swoole\Server $server, string $data, array $client_info){

    var_dump($data,$client_info);
    $server->sendto($client_info['address'],$client_info['port'],'来自udp服务器的数据');
});
$server->start();